The ARIA spec is clear on this: when an element has the
HIDDEN state, it should not be presented in the accessible
tree.
This change is incomplete, we also need to emit child-added/
removed signals when the state changes, but that needs to
wait for the child added infrastructure to land.
gboolean
gtk_accessible_should_present (GtkAccessible *self)
{
+ GtkATContext *context;
+
if (GTK_IS_WIDGET (self) &&
!gtk_widget_get_visible (GTK_WIDGET (self)))
return FALSE;
if (gtk_accessible_get_accessible_role (self) == GTK_ACCESSIBLE_ROLE_NONE)
return FALSE;
+ context = gtk_accessible_get_at_context (self);
+ if (gtk_at_context_has_accessible_state (context, GTK_ACCESSIBLE_STATE_HIDDEN))
+ {
+ GtkAccessibleValue *value;
+
+ value = gtk_at_context_get_accessible_state (context, GTK_ACCESSIBLE_STATE_HIDDEN);
+ if (gtk_boolean_accessible_value_get (value))
+ return FALSE;
+ }
+
return TRUE;
}